<?php
/**
 * Created by PhpStorm.
 * User: mj
 * Date: 17-6-7
 * Time: 下午2:11
 */

namespace App\Winged\Auth\Api;



class Auth extends Api
{
    public static $actions = [
        'login'  => 'auth/login',
    ];

    public static $needToken = false;

    /**
     * @param $credentials ['name' => 'xxx' , 'password' => 'xxx']
     */
    public static function login($credentials, $tenant)
    {
        static::$headers['tenant_id'] = $tenant;

        $data ['_request_content_type'] = 'body' ;
        $data ['body'] = $credentials ;

        return self::doPost('login', $data);
    }
}
